﻿<bases:UserControlBase x:Class="PeoplesJukebox.Web.UserControls.ResultsList"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:bases="clr-namespace:PeoplesJukebox.Web.Bases"
    xmlns:pages="clr-namespace:PeoplesJukebox.Web.Pages">

    <StackPanel>

        <ListBox x:Name="dgResults" SelectionChanged="dgResults_SelectionChanged" 
                 ScrollViewer.VerticalScrollBarVisibility="Auto"
                 Width="600" Height="380" Style="{StaticResource ResultsListBox}" >
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal" Width="590" HorizontalAlignment="Center">
                        <Image Source="{Binding ItemType, Converter={StaticResource ItemTypeImageConverter}}" Margin="10" Height="36" Width="36"/>
                        <StackPanel Orientation="Vertical" HorizontalAlignment="Center">
                            <TextBlock Text="{Binding Name}" Margin="5"/>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="from" FontWeight="Normal" FontStyle="Italic" Margin="5" Visibility="{Binding AlbumName, Converter={StaticResource StringVisibilityConverter}}"/>
                                <TextBlock Text="{Binding AlbumName}" Margin="5" Visibility="{Binding AlbumName, Converter={StaticResource StringVisibilityConverter}}"/>
                                <TextBlock Text="by" FontWeight="Normal" FontStyle="Italic" Margin="5" Visibility="{Binding ArtistName, Converter={StaticResource StringVisibilityConverter}}"/>
                                <TextBlock Text="{Binding ArtistName}" Margin="5" Visibility="{Binding ArtistName, Converter={StaticResource StringVisibilityConverter}}"/>
                            </StackPanel>
                        </StackPanel>
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </StackPanel>

</bases:UserControlBase>
